<template>
    <div>
        <el-row>
            <UEditor ref="ueRef"></UEditor>
            <el-button type="primary" @click="buttonClickHandle">父组件 Get UE Content (Console)</el-button>
        </el-row>
      <el-row>
        <WangEditor ref="wangEditorRef"></WangEditor>

        <el-button type="primary" @click="editorButtonClickHandle">父组件 Get UE Content (Console)</el-button>
      </el-row>
    </div>
</template>

<script>
import UEditor from "@/components/UEditor";
import WangEditor from "@/components/WangEditor";

export default {
    name: "Ueditor",
    components:{
        UEditor,
      WangEditor
    },
    data(){
        return {

        }
    },
    created: function () {
      setTimeout(()=>{
        this.$refs.wangEditorRef.setEditorHtml('<h2>wangEditor</h2>')
      },500)
    },
    methods: {
      editorButtonClickHandle(){
        let refs =  this.$refs.wangEditorRef;

        let wangEditorRef1 = refs
        if (wangEditorRef1 != null) {
          console.log(wangEditorRef1.getEditorHtml())
          console.log(wangEditorRef1.getEditorText())
        }
      },
        buttonClickHandle(){
            var a = this.$refs.ueRef.getContent();
            console.log(a);
        }
    }
}
</script>

<style scoped>

</style>